\(\int \sqrt {d \sec (e+f x)} (a+b \tan (e+f x))^3 \, dx\) [596]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [C] (verified)
   Fricas [C] (verification not implemented)
   Sympy [F]
   Maxima [F]
   Giac [F]
   Mupad [F(-1)]

Optimal result

Integrand size = 25, antiderivative size = 129 \[ \int \sqrt {d \sec (e+f x)} (a+b \tan (e+f x))^3 \, dx=\frac {2 a \left (a^2-2 b^2\right ) \operatorname {EllipticF}\left (\frac {1}{2} \arctan (\tan (e+f x)),2\right ) \sqrt {d \sec (e+f x)}}{f \sqrt [4]{\sec ^2(e+f x)}}+\frac {2 b \sqrt {d \sec (e+f x)} (a+b \tan (e+f x))^2}{5 f}+\frac {2 b \sqrt {d \sec (e+f x)} \left (2 \left (7 a^2-2 b^2\right )+3 a b \tan (e+f x)\right )}{5 f} \]

[Out]

2*a*(a^2-2*b^2)*(cos(1/2*arctan(tan(f*x+e)))^2)^(1/2)/cos(1/2*arctan(tan(f*x+e)))*EllipticF(sin(1/2*arctan(tan
(f*x+e))),2^(1/2))*(d*sec(f*x+e))^(1/2)/f/(sec(f*x+e)^2)^(1/4)+2/5*b*(d*sec(f*x+e))^(1/2)*(a+b*tan(f*x+e))^2/f
+2/5*b*(d*sec(f*x+e))^(1/2)*(14*a^2-4*b^2+3*a*b*tan(f*x+e))/f

Rubi [A] (verified)

Time = 0.13 (sec) , antiderivative size = 129, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.160, Rules used = {3593, 757, 794, 237} \[ \int \sqrt {d \sec (e+f x)} (a+b \tan (e+f x))^3 \, dx=\frac {2 a \left (a^2-2 b^2\right ) \sqrt {d \sec (e+f x)} \operatorname {EllipticF}\left (\frac {1}{2} \arctan (\tan (e+f x)),2\right )}{f \sqrt [4]{\sec ^2(e+f x)}}+\frac {2 b \sqrt {d \sec (e+f x)} \left (2 \left (7 a^2-2 b^2\right )+3 a b \tan (e+f x)\right )}{5 f}+\frac {2 b \sqrt {d \sec (e+f x)} (a+b \tan (e+f x))^2}{5 f} \]

[In]

Int[Sqrt[d*Sec[e + f*x]]*(a + b*Tan[e + f*x])^3,x]

[Out]

(2*a*(a^2 - 2*b^2)*EllipticF[ArcTan[Tan[e + f*x]]/2, 2]*Sqrt[d*Sec[e + f*x]])/(f*(Sec[e + f*x]^2)^(1/4)) + (2*
b*Sqrt[d*Sec[e + f*x]]*(a + b*Tan[e + f*x])^2)/(5*f) + (2*b*Sqrt[d*Sec[e + f*x]]*(2*(7*a^2 - 2*b^2) + 3*a*b*Ta
n[e + f*x]))/(5*f)

Rule 237

Int[((a_) + (b_.)*(x_)^2)^(-3/4), x_Symbol] :> Simp[(2/(a^(3/4)*Rt[b/a, 2]))*EllipticF[(1/2)*ArcTan[Rt[b/a, 2]
*x], 2], x] /; FreeQ[{a, b}, x] && GtQ[a, 0] && PosQ[b/a]

Rule 757

Int[((d_) + (e_.)*(x_))^(m_)*((a_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Simp[e*(d + e*x)^(m - 1)*((a + c*x^2)^(p
 + 1)/(c*(m + 2*p + 1))), x] + Dist[1/(c*(m + 2*p + 1)), Int[(d + e*x)^(m - 2)*Simp[c*d^2*(m + 2*p + 1) - a*e^
2*(m - 1) + 2*c*d*e*(m + p)*x, x]*(a + c*x^2)^p, x], x] /; FreeQ[{a, c, d, e, m, p}, x] && NeQ[c*d^2 + a*e^2,
0] && If[RationalQ[m], GtQ[m, 1], SumSimplerQ[m, -2]] && NeQ[m + 2*p + 1, 0] && IntQuadraticQ[a, 0, c, d, e, m
, p, x]

Rule 794

Int[((d_.) + (e_.)*(x_))*((f_.) + (g_.)*(x_))*((a_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Simp[((e*f + d*g)*(2*p
+ 3) + 2*e*g*(p + 1)*x)*((a + c*x^2)^(p + 1)/(2*c*(p + 1)*(2*p + 3))), x] - Dist[(a*e*g - c*d*f*(2*p + 3))/(c*
(2*p + 3)), Int[(a + c*x^2)^p, x], x] /; FreeQ[{a, c, d, e, f, g, p}, x] &&  !LeQ[p, -1]

Rule 3593

Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[d^(2*
IntPart[m/2])*((d*Sec[e + f*x])^(2*FracPart[m/2])/(b*f*(Sec[e + f*x]^2)^FracPart[m/2])), Subst[Int[(a + x)^n*(
1 + x^2/b^2)^(m/2 - 1), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, d, e, f, m, n}, x] && NeQ[a^2 + b^2, 0] &&
 !IntegerQ[m/2]

Rubi steps \begin{align*} \text {integral}& = \frac {\sqrt {d \sec (e+f x)} \text {Subst}\left (\int \frac {(a+x)^3}{\left (1+\frac {x^2}{b^2}\right )^{3/4}} \, dx,x,b \tan (e+f x)\right )}{b f \sqrt [4]{\sec ^2(e+f x)}} \\ & = \frac {2 b \sqrt {d \sec (e+f x)} (a+b \tan (e+f x))^2}{5 f}+\frac {\left (2 b \sqrt {d \sec (e+f x)}\right ) \text {Subst}\left (\int \frac {(a+x) \left (\frac {1}{2} \left (-4+\frac {5 a^2}{b^2}\right )+\frac {9 a x}{2 b^2}\right )}{\left (1+\frac {x^2}{b^2}\right )^{3/4}} \, dx,x,b \tan (e+f x)\right )}{5 f \sqrt [4]{\sec ^2(e+f x)}} \\ & = \frac {2 b \sqrt {d \sec (e+f x)} (a+b \tan (e+f x))^2}{5 f}+\frac {2 b \sqrt {d \sec (e+f x)} \left (2 \left (7 a^2-2 b^2\right )+3 a b \tan (e+f x)\right )}{5 f}-\frac {\left (a \left (2-\frac {a^2}{b^2}\right ) b \sqrt {d \sec (e+f x)}\right ) \text {Subst}\left (\int \frac {1}{\left (1+\frac {x^2}{b^2}\right )^{3/4}} \, dx,x,b \tan (e+f x)\right )}{f \sqrt [4]{\sec ^2(e+f x)}} \\ & = \frac {2 a \left (a^2-2 b^2\right ) \operatorname {EllipticF}\left (\frac {1}{2} \arctan (\tan (e+f x)),2\right ) \sqrt {d \sec (e+f x)}}{f \sqrt [4]{\sec ^2(e+f x)}}+\frac {2 b \sqrt {d \sec (e+f x)} (a+b \tan (e+f x))^2}{5 f}+\frac {2 b \sqrt {d \sec (e+f x)} \left (2 \left (7 a^2-2 b^2\right )+3 a b \tan (e+f x)\right )}{5 f} \\ \end{align*}

Mathematica [A] (verified)

Time = 3.91 (sec) , antiderivative size = 132, normalized size of antiderivative = 1.02 \[ \int \sqrt {d \sec (e+f x)} (a+b \tan (e+f x))^3 \, dx=-\frac {2 \sqrt {d \sec (e+f x)} \left (5 b \left (-3 a^2+b^2\right ) \cos ^3(e+f x)-5 a \left (a^2-2 b^2\right ) \cos ^{\frac {7}{2}}(e+f x) \operatorname {EllipticF}\left (\frac {1}{2} (e+f x),2\right )-\frac {1}{2} b^2 \cos (e+f x) (2 b+5 a \sin (2 (e+f x)))\right ) (a+b \tan (e+f x))^3}{5 f (a \cos (e+f x)+b \sin (e+f x))^3} \]

[In]

Integrate[Sqrt[d*Sec[e + f*x]]*(a + b*Tan[e + f*x])^3,x]

[Out]

(-2*Sqrt[d*Sec[e + f*x]]*(5*b*(-3*a^2 + b^2)*Cos[e + f*x]^3 - 5*a*(a^2 - 2*b^2)*Cos[e + f*x]^(7/2)*EllipticF[(
e + f*x)/2, 2] - (b^2*Cos[e + f*x]*(2*b + 5*a*Sin[2*(e + f*x)]))/2)*(a + b*Tan[e + f*x])^3)/(5*f*(a*Cos[e + f*
x] + b*Sin[e + f*x])^3)

Maple [C] (verified)

Result contains complex when optimal does not.

Time = 21.26 (sec) , antiderivative size = 298, normalized size of antiderivative = 2.31

method result size
default \(\frac {2 \sqrt {d \sec \left (f x +e \right )}\, \left (-5 i \cos \left (f x +e \right ) \sqrt {\frac {1}{\cos \left (f x +e \right )+1}}\, \sqrt {\frac {\cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}\, F\left (i \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )\right ), i\right ) a^{3}+10 i \cos \left (f x +e \right ) \sqrt {\frac {1}{\cos \left (f x +e \right )+1}}\, \sqrt {\frac {\cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}\, F\left (i \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )\right ), i\right ) a \,b^{2}-5 i \sqrt {\frac {1}{\cos \left (f x +e \right )+1}}\, F\left (i \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )\right ), i\right ) \sqrt {\frac {\cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}\, a^{3}+10 i \sqrt {\frac {1}{\cos \left (f x +e \right )+1}}\, F\left (i \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )\right ), i\right ) \sqrt {\frac {\cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}\, a \,b^{2}+5 \tan \left (f x +e \right ) a \,b^{2}+15 a^{2} b -5 b^{3}+b^{3} \left (\sec ^{2}\left (f x +e \right )\right )\right )}{5 f}\) \(298\)
parts \(-\frac {2 i a^{3} \left (\cos \left (f x +e \right )+1\right ) F\left (i \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )\right ), i\right ) \sqrt {d \sec \left (f x +e \right )}\, \sqrt {\frac {1}{\cos \left (f x +e \right )+1}}\, \sqrt {\frac {\cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}}{f}-\frac {b^{3} \sqrt {d \sec \left (f x +e \right )}\, \left (20 \cos \left (f x +e \right ) \sqrt {-\frac {\cos \left (f x +e \right )}{\left (\cos \left (f x +e \right )+1\right )^{2}}}-5 \cos \left (f x +e \right ) \ln \left (\frac {2 \cos \left (f x +e \right ) \sqrt {-\frac {\cos \left (f x +e \right )}{\left (\cos \left (f x +e \right )+1\right )^{2}}}+2 \sqrt {-\frac {\cos \left (f x +e \right )}{\left (\cos \left (f x +e \right )+1\right )^{2}}}-\cos \left (f x +e \right )+1}{\cos \left (f x +e \right )+1}\right )+5 \cos \left (f x +e \right ) \ln \left (\frac {4 \cos \left (f x +e \right ) \sqrt {-\frac {\cos \left (f x +e \right )}{\left (\cos \left (f x +e \right )+1\right )^{2}}}+4 \sqrt {-\frac {\cos \left (f x +e \right )}{\left (\cos \left (f x +e \right )+1\right )^{2}}}-2 \cos \left (f x +e \right )+2}{\cos \left (f x +e \right )+1}\right )+20 \sqrt {-\frac {\cos \left (f x +e \right )}{\left (\cos \left (f x +e \right )+1\right )^{2}}}-4 \sec \left (f x +e \right ) \sqrt {-\frac {\cos \left (f x +e \right )}{\left (\cos \left (f x +e \right )+1\right )^{2}}}-4 \left (\sec ^{2}\left (f x +e \right )\right ) \sqrt {-\frac {\cos \left (f x +e \right )}{\left (\cos \left (f x +e \right )+1\right )^{2}}}\right )}{10 f \sqrt {-\frac {\cos \left (f x +e \right )}{\left (\cos \left (f x +e \right )+1\right )^{2}}}\, \left (\cos \left (f x +e \right )+1\right )}+\frac {6 a^{2} b \sqrt {d \sec \left (f x +e \right )}}{f}+\frac {2 a \,b^{2} \sqrt {d \sec \left (f x +e \right )}\, \left (2 i \cos \left (f x +e \right ) F\left (i \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )\right ), i\right ) \sqrt {\frac {1}{\cos \left (f x +e \right )+1}}\, \sqrt {\frac {\cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}+2 i \sqrt {\frac {\cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}\, F\left (i \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )\right ), i\right ) \sqrt {\frac {1}{\cos \left (f x +e \right )+1}}+\tan \left (f x +e \right )\right )}{f}\) \(560\)

[In]

int((d*sec(f*x+e))^(1/2)*(a+b*tan(f*x+e))^3,x,method=_RETURNVERBOSE)

[Out]

2/5/f*(d*sec(f*x+e))^(1/2)*(-5*I*cos(f*x+e)*(cos(f*x+e)/(cos(f*x+e)+1))^(1/2)*(1/(cos(f*x+e)+1))^(1/2)*Ellipti
cF(I*(csc(f*x+e)-cot(f*x+e)),I)*a^3+10*I*cos(f*x+e)*(cos(f*x+e)/(cos(f*x+e)+1))^(1/2)*(1/(cos(f*x+e)+1))^(1/2)
*EllipticF(I*(csc(f*x+e)-cot(f*x+e)),I)*a*b^2-5*I*(cos(f*x+e)/(cos(f*x+e)+1))^(1/2)*(1/(cos(f*x+e)+1))^(1/2)*E
llipticF(I*(csc(f*x+e)-cot(f*x+e)),I)*a^3+10*I*(cos(f*x+e)/(cos(f*x+e)+1))^(1/2)*(1/(cos(f*x+e)+1))^(1/2)*Elli
pticF(I*(csc(f*x+e)-cot(f*x+e)),I)*a*b^2+5*tan(f*x+e)*a*b^2+15*a^2*b-5*b^3+b^3*sec(f*x+e)^2)

Fricas [C] (verification not implemented)

Result contains higher order function than in optimal. Order 9 vs. order 4.

Time = 0.10 (sec) , antiderivative size = 164, normalized size of antiderivative = 1.27 \[ \int \sqrt {d \sec (e+f x)} (a+b \tan (e+f x))^3 \, dx=-\frac {5 \, \sqrt {2} {\left (i \, a^{3} - 2 i \, a b^{2}\right )} \sqrt {d} \cos \left (f x + e\right )^{2} {\rm weierstrassPInverse}\left (-4, 0, \cos \left (f x + e\right ) + i \, \sin \left (f x + e\right )\right ) + 5 \, \sqrt {2} {\left (-i \, a^{3} + 2 i \, a b^{2}\right )} \sqrt {d} \cos \left (f x + e\right )^{2} {\rm weierstrassPInverse}\left (-4, 0, \cos \left (f x + e\right ) - i \, \sin \left (f x + e\right )\right ) - 2 \, {\left (5 \, a b^{2} \cos \left (f x + e\right ) \sin \left (f x + e\right ) + b^{3} + 5 \, {\left (3 \, a^{2} b - b^{3}\right )} \cos \left (f x + e\right )^{2}\right )} \sqrt {\frac {d}{\cos \left (f x + e\right )}}}{5 \, f \cos \left (f x + e\right )^{2}} \]

[In]

integrate((d*sec(f*x+e))^(1/2)*(a+b*tan(f*x+e))^3,x, algorithm="fricas")

[Out]

-1/5*(5*sqrt(2)*(I*a^3 - 2*I*a*b^2)*sqrt(d)*cos(f*x + e)^2*weierstrassPInverse(-4, 0, cos(f*x + e) + I*sin(f*x
 + e)) + 5*sqrt(2)*(-I*a^3 + 2*I*a*b^2)*sqrt(d)*cos(f*x + e)^2*weierstrassPInverse(-4, 0, cos(f*x + e) - I*sin
(f*x + e)) - 2*(5*a*b^2*cos(f*x + e)*sin(f*x + e) + b^3 + 5*(3*a^2*b - b^3)*cos(f*x + e)^2)*sqrt(d/cos(f*x + e
)))/(f*cos(f*x + e)^2)

Sympy [F]

\[ \int \sqrt {d \sec (e+f x)} (a+b \tan (e+f x))^3 \, dx=\int \sqrt {d \sec {\left (e + f x \right )}} \left (a + b \tan {\left (e + f x \right )}\right )^{3}\, dx \]

[In]

integrate((d*sec(f*x+e))**(1/2)*(a+b*tan(f*x+e))**3,x)

[Out]

Integral(sqrt(d*sec(e + f*x))*(a + b*tan(e + f*x))**3, x)

Maxima [F]

\[ \int \sqrt {d \sec (e+f x)} (a+b \tan (e+f x))^3 \, dx=\int { \sqrt {d \sec \left (f x + e\right )} {\left (b \tan \left (f x + e\right ) + a\right )}^{3} \,d x } \]

[In]

integrate((d*sec(f*x+e))^(1/2)*(a+b*tan(f*x+e))^3,x, algorithm="maxima")

[Out]

integrate(sqrt(d*sec(f*x + e))*(b*tan(f*x + e) + a)^3, x)

Giac [F]

\[ \int \sqrt {d \sec (e+f x)} (a+b \tan (e+f x))^3 \, dx=\int { \sqrt {d \sec \left (f x + e\right )} {\left (b \tan \left (f x + e\right ) + a\right )}^{3} \,d x } \]

[In]

integrate((d*sec(f*x+e))^(1/2)*(a+b*tan(f*x+e))^3,x, algorithm="giac")

[Out]

integrate(sqrt(d*sec(f*x + e))*(b*tan(f*x + e) + a)^3, x)

Mupad [F(-1)]

Timed out. \[ \int \sqrt {d \sec (e+f x)} (a+b \tan (e+f x))^3 \, dx=\int \sqrt {\frac {d}{\cos \left (e+f\,x\right )}}\,{\left (a+b\,\mathrm {tan}\left (e+f\,x\right )\right )}^3 \,d x \]

[In]

int((d/cos(e + f*x))^(1/2)*(a + b*tan(e + f*x))^3,x)

[Out]

int((d/cos(e + f*x))^(1/2)*(a + b*tan(e + f*x))^3, x)